package com.example.hongyu.avtt.util;

import com.blankj.utilcode.util.SPUtils;

/**
 * RongWen
 * Created by Dan on 2019/1/17
 * [Model Function]
 * Version 1.0
 * CopyRight Mycard
 */
public class SPUtil {

    private static final String LOGIN = "login";
    private static final String ACCOUNT = "account";
    private static final String PASSWORD = "password";
    private static final String REMEMBER = "remember";

    private static final String USER = "user";
    private static final String NUMBER = "number";
    private static final String UID = "uid";
    private static final String DEPT = "dept";

    public static String getAccount(){
        return SPUtils.getInstance(LOGIN).getString(ACCOUNT);
    }

    public static void setAccount(String account){
        SPUtils.getInstance(LOGIN).put(ACCOUNT, account);
    }

    public static String getPassword(){
        return SPUtils.getInstance(LOGIN).getString(PASSWORD);
    }

    public static void setPassword(String password){
        SPUtils.getInstance(LOGIN).put(PASSWORD, password);
    }

    public static boolean isRemember(){
        return SPUtils.getInstance(LOGIN).getBoolean(REMEMBER);
    }

    public static void setRemember(boolean remember){
        SPUtils.getInstance(LOGIN).put(REMEMBER, remember);
    }

    public static String getNumber(){
        return SPUtils.getInstance(USER).getString(NUMBER);
    }

    public static void setNumber(String number){
        SPUtils.getInstance(USER).put(NUMBER, number);
    }

    public static int getUid(){
        return SPUtils.getInstance(USER).getInt(UID);
    }

    public static void setUid(int uid){
        SPUtils.getInstance(USER).put(UID, uid);
    }

    public static String getDept(){
        return SPUtils.getInstance(USER).getString(DEPT);
    }

    public static void setDept(String dept){
        SPUtils.getInstance(USER).put(DEPT, dept);
    }
}
